package com.example.springbootlearn.security.mapper;


import com.example.springbootlearn.security.pojo.Role;
import com.example.springbootlearn.security.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author libo
 * @Date 2024/1/5 22:24
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where username=#{username}")
    User loadByUserName(String username);

    @Select("select r.* from role r,user_role ur where ur.uid=#{uid} and ur.rid=r.id")
    List<Role> loadRolesByUid(Integer uid);
}
